import store from '@/store'

export function disposeDict(str, type) {
    let dicts = {}
    let data = store.getters.basic
    for (let index = 0; index < data.length; index++) {
        if (data[index].text == str) {
            if (type == 'obj') return data[index].obj
            if (type == 'arr') {
                return data[index].value
            }

        }

    }
}
export function disposeToObj(data, str) {
    let dicts = {}
    data.forEach(element => {

        if (element.label == str) {
            let arr = element.value
            arr.forEach(obj => {
                dicts[obj.value] = obj.name
            })
        }

    });

    return dicts
}